/* @settings

name: Recent Notes
id: recent-notes
settings:
    - 
        id: recent-notes-hover-color
        title: Hover Color
        description: Background color when hovering over notes
        type: variable-themed-color
        format: hex
        opacity: true
        default-light: '#E8E9EA'
        default-dark: '#2D3034'
    -
        id: recent-notes-active-color
        title: Active Note Color
        description: Background color for the currently active note
        type: variable-themed-color
        format: hex
        opacity: true
        default-light: '#E8E9EA'
        default-dark: '#2D3034'
    -
        id: recent-notes-active-text-color
        title: Active Note Text Color
        description: Text color for the currently active note
        type: variable-themed-color
        format: hex
        opacity: true
        default-light: '#E8E9EA'
        default-dark: '#2D3034'
    -
        id: recent-notes-hover-text-color
        title: Hovered Note Text Color
        description: Text color for hovered notes
        type: variable-themed-color
        format: hex
        opacity: true
        default-light: '#E8E9EA'
        default-dark: '#2D3034'
*/

/* Apply default theme variables if custom ones are not set */
body {
    --recent-notes-item-background-hover: transparent;
}

.recent-note-item {
    padding: 10px 18px;
    margin: 1px 0px 0px 0px;
    cursor: pointer;
    border-radius: 4px;
}
.recent-notes-view .view-content {
    height: 100%;
    overflow-y: auto;
}

.recent-note-title {
    font-size: var(--nav-item-size);
    font-weight: 600;
    margin-bottom: 0px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}
.recent-note-date {
    color: var(--text-muted);
    flex-shrink: 0;
    order: -1;
}
.recent-note-date-below {
    width: 100%;
    margin-top: 0px;
    order: 2;
}
.recent-note-info {
    display: flex;
    align-items: flex-start;
    gap: 4px 8px;
    color: var(--text-muted);
    font-size: calc(var(--nav-item-size) * 0.9);
    min-height: 1.3em;
}

/* When no preview is shown, adjust date position */
.recent-note-info:empty {
    justify-content: flex-end;
}

/* When no preview and no time are shown, hide the info container */
.recent-note-info:empty {
    display: none;
}

.recent-notes-view h6 {
    top: -14px;
    padding: 6px 0px;
    margin: 26px 0px 0px 0px;
    color: var(--text-muted);
    font-size: calc(var(--nav-item-size) * 0.9);
    font-weight: 500;
    z-index: 1;
    border-bottom: 1px solid var(--background-modifier-border);
}
.recent-notes-view h6:first-of-type {
    margin-top: 0px;
}

.recent-note-preview {
    flex: 1 1 auto;
    min-width: 0;
    opacity: 0.7;
    order: 1;
}

/* Single line layout */
.recent-note-preview-line {
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
    line-height: 1.3;
}

/* Multiple lines layout */
.recent-note-info.has-multiple-lines {
    flex-wrap: wrap;
}

.recent-note-preview.has-multiple-lines {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Active State */
.recent-note-item.is-active {
    background-color: var(--recent-notes-active-color, var(--nav-item-background-active));
    color: var(--recent-notes-active-text-color);
}
.recent-note-item.is-active .recent-note-date,
.recent-note-item.is-active .recent-note-info {
    color: var(--recent-notes-active-text-color, var(--text-muted));
}

.recent-note-item:hover:not(.is-active) {
    background-color: var(--recent-notes-hover-color, var(--recent-notes-item-background-hover));
    color: var(--recent-notes-hover-text-color);
}
.recent-note-item:hover:not(.is-active) .recent-note-date {
    color: var(--recent-notes-hover-text-color, var(--text-muted));
}
.recent-note-item:hover:not(.is-active) .recent-note-info {
    color: var(--recent-notes-hover-text-color, var(--text-muted));
}

/* Pin icon in Pinned header */
.pin-icon-small {
    --icon-size: 1.1em;
    position: relative;
    top: 2px;
    margin-right: 4px;
}

/* Compact view styles */
body[data-recent-notes-density="compact"] div.recent-note-item {
    padding: 5px;
}

body[data-recent-notes-density="compact"] .recent-notes-view h6 {
    margin: 0;
}

body[data-recent-notes-density="compact"] div.recent-note-item:hover:not(.is-active) {
    background: var(--background-modifier-hover);
}

body[data-recent-notes-density="compact"] .recent-note-header {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    width: 100%;
}

body[data-recent-notes-density="compact"] .recent-note-title {
    flex-grow: 1; 
    text-align: left; 
    overflow: hidden;
    white-space: nowrap;
    text-overflow: clip;
    order: 1;
}

body[data-recent-notes-density="compact"] .recent-note-date {
    color: gray;
    font-size: 0.8em;
    white-space: nowrap; 
    margin-left: 8px;
    order: 2;
}

body[data-recent-notes-density="compact"] .recent-note-preview {
    margin-top: 2px;
    font-size: 0.85em;
    color: var(--text-muted);
}

body[data-recent-notes-density="compact"] .recent-note-preview-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}

